﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Hydra.Reciever;

namespace Hydra.Studio
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        //protected override void OnSourceInitialized(EventArgs e)
        //{
        //    base.OnSourceInitialized(e);

        //    HwndSource source = PresentationSource.FromVisual(this) as HwndSource;
        //    source.AddHook(WndProc);
        //}

        private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            // WM_CREATE
            if (msg == 0x0001)
            {
                // Append a sub-menu "About" to system menu
                //HMENU hMenu = GetSystemMenu(FALSE);
                //AppendMenuW(hMenu, MF_ENABLED | MF_STRING, IDM_ABOUT, L"&About");
                MessageBox.Show("WM_CREATE");
            }
            // WM_INITDIALOG
            else if (msg == 0x0110)
            {
                MessageBox.Show("WM_INITDIALOG");
            }
            // WM_INITMENU
            else if (msg == 0x0116)
            {
                MessageBox.Show("WM_INITMENU");
                handled = false;
            }
            // WM_SYSCOMMAND
            else if (msg == 0x0112
                //&& LOWORD(wParam) == IDM_ABOUT
                )
            {
                //    CString szStuff = L"NetShare v2 ("
                //#ifdef _M_X64
                //    L"x64"
                //#else
                //    L"x86"
                //#endif
                //    L"), Powered by Visual Studio 2012 (Target vc10)\r\nCompiled at ";

                //    szStuff += __DATE__;
                //    szStuff += L" ";
                //    szStuff += __TIME__;


                //    return MessageBox(szStuff, L"About", MB_OK | MB_ICONINFORMATION);            
            }
            return (IntPtr)1;
        }

        //private void Button_Click_WriteLog(object sender, RoutedEventArgs e)
        //{
        //    Host.Agent.WriteLog("Host button clicked....");
        //}

        //private void Button_Click_RunTask(object sender, RoutedEventArgs e)
        //{
        //    Host.Agent.RunTask("Complicated task.!!");
        //}
    }
}
